<template>
	<zero-markdown-view :markdown="userContent"></zero-markdown-view>
</template>

<script setup>
import { computed } from 'vue';
const props = defineProps(['msg']);
const userContent = computed(() => {
	if (!props.msg) {
		return;
	}
	let htmlString = '';
	// 判断markdown中代码块标识符的数量是否为偶数
	if (props.msg.split('```').length % 2) {
		let content = props.msg;
		if (content[content.length - 1] != '\n') {
			content += '\n';
		}
		htmlString = content;
	} else {
		htmlString = props.msg;
	}
	return htmlString;

	return props.msg;
});
</script>

<style></style>
